package net.jlibrary.account.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.BatchSize;

import net.jlibrary.common.core.annotation.CodeGenComment;
import net.jlibrary.common.core.annotation.SearchCondition;
import net.jlibrary.common.core.annotation.SearchField;
import net.jlibrary.common.core.annotation.SeePurview;
import net.jlibrary.common.project.domain.Account;
import net.jlibrary.common.project.domain.Group;

/**
 * 后台用户
 * @author fzys
 *
 */
@Entity(name = "tab_employee")
@PrimaryKeyJoinColumn(name = "account_id")
@BatchSize(size = 15)
@CodeGenComment(value = "后台用户", genSelect = false,add=false,update=false,delete=false)
@SeePurview(value="group.globalPath")
public class Employee extends Account {
	private static final long serialVersionUID = 3695620116829404516L;
	@Column(length = 20)
	@CodeGenComment(value = "手机号", viewList = true, viewSearch = true,required = true, maxLength = 20)
	@SearchField(value = "mobile", condition = SearchCondition.EQUAL)
	private String mobile;
	@Temporal(TemporalType.TIMESTAMP)
	@CodeGenComment(value = "入职日期", viewList = true)
	private Date joinDate;// 入职日期
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public Date getJoinDate() {
		return joinDate;
	}
	public void setJoinDate(Date joinDate) {
		this.joinDate = joinDate;
	}
	
	
	public boolean equals(Object rhs) {
		if (rhs == null)
			return false;
		if (!(rhs instanceof Group))
			return false;
		Employee that = (Employee) rhs;
		if (this.getId() == null || that.getId() == null)
			return false;
		return (this.getId().equals(that.getId()));
	}

	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
		return result;
	}
}
